# -*- coding: utf-8 -*-
from scpy.logger import get_logger
import os
import sys
from cassandra.auth import PlainTextAuthProvider
reload(sys)
sys.setdefaultencoding('utf-8')

logger = get_logger(__file__)

CURRENT_PATH = os.path.dirname(__file__)
if CURRENT_PATH:
    CURRENT_PATH = CURRENT_PATH + "/"
login_url = 'http://www.hqrm.cn/Login.do?r=0.6668664228636771'
search_url = 'http://www.hqrm.cn/Home/Hr/FutureWorries/SearchResumes.do'
resumeDetail_url = 'http://www.hqrm.cn/Home/Hr/FutureWorries/ResumeDetail.aspx'
header_login = {
    'Accept':'application/json, text/javascript, */*; q=0.01',
    'Accept-Encoding':'gzip, deflate',
    'Accept-Language':'zh-CN,zh;q=0.8',
    'Cache-Control':'no-cache',
    'Connection':'keep-alive',
    'Content-Length':500,
    'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
    'Cookie':None,
    'Host':'www.hqrm.cn',
    'Origin':'http://www.hqrm.cn',
    'Pragma':'no-cache',
    'Referer':'http://www.hqrm.cn/login.aspx',
    'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36',
    'X-Requested-With':'XMLHttpRequest',
    }
header_searchjoblist = {
        'Accept':'application/json, text/javascript, */*; q=0.01',
        'Accept-Encoding':'gzip, deflate',
        'Accept-Language':'zh-CN,zh;q=0.8',
        'Cache-Control':'no-cache',
        'Connection':'keep-alive',
        'Content-Length':500,
        'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8',
        'Cookie':None,
        'Host':'www.hqrm.cn',
        'Origin':'http://www.hqrm.cn',
        'Pragma':'no-cache',
        'Referer':'http://www.hqrm.cn/Home/Hr/FutureWorries/SearchResumes.aspx?r=0.43051467346958816',
        'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36',
        'X-Requested-With':'XMLHttpRequest',
        }
header_resumedetail = {
    'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
    'Accept-Encoding':'gzip, deflate, sdch',
    'Accept-Language':'zh-CN,zh;q=0.8',
    'Cache-Control':'no-cache',
    'Connection':'keep-alive',
    'Cookie':None,
    'Host':'www.hqrm.cn',
    'Pragma':'no-cache',
    'Upgrade-Insecure-Requests':1,
    'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36',
}
form_values = {
    'txtLoginName':'chi.che@socialcredits.cn',
    'txtPwd':'jy03055084',
    'Status':'1',
    'UserType':0,
    'IsHaveCompany':bool(1),
    'TimeOut':'0'
    }
MONGODB_SERVER = "192.168.31.114"
MONGODB_PORT = 27017
MONGODB_DB = "resume"
MONGODB_DB_RECRUITMENT = "crawler_company_all"
MONGODB_DB_organization = 'organization'
MONGODB_COLLECTION_RESUMEINFO = 'resumeList'
MONGODB_COLLECTION = "hqrm_company"
MONGODB_COLLECTION_JUXIAN = "juxian_company"
MONGODB_COLLECTION_COOKIE = "cookie"
MONGODB_COLLECTION_organization = 'companyNameStrict_2015_12'
MONGODB_COLLECTION_RECRUITMENT = 'recruitment'
cassendraHost = ('192.168.31.242', '192.168.31.243')
auth_provider = PlainTextAuthProvider(username='cassandra', password='15th January')
cassendraKeySpace = 'crawler'
amqp_url = 'amqp://sc-admin:1qaz2wsx@192.168.31.114:5672/%2F?connection_attempts=3&heartbeat_interval=3600'
amp_Name = 'companyName'
QUEUE_MAX_SIZE = 100000
QUEUE_HOST = "192.168.31.114"
QUEUE_NAME = 'companyName'
QUEUE_NAME_RECRUITMENT = 'companyNameRecruitment'
QUEUE_USER = 'sc-admin'
QUEUE_PASSWORD = '1qaz2wsx'
KAFAKA_TOPIC = 'company_name'
KAFAKA_TOPIC_RECRUITMENT = 'company_name_recruitment'
KAFAKA_HOST = '192.168.31.114:9092'

# config for monitor
MONGODB_DB_MONITOR = 'monitor'
MONGODB_COLLECTION_MONITOR_RESUME = "resumeMonitor"
MONGODB_COLLECTION_MONITOR_RECRUITMENT = 'recruitmentMonitor'
MONGODB_COLLECTION_MONITOR_COMPANYLIST = 'companyList'

# from 51 job search company cid
CIDSEARCH_URL_51JOB = 'http://search.51job.com/jobsearch/search_result.php'
CIDSEARCHHEADER_51JOB = {
        'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
        'Accept-Encoding':'gzip, deflate',
        'Content-Type':'application/x-www-form-urlencoded',
        'Host':'search.51job.com',
        'Origin':'http://jobs.51job.com',
        'Referer':'http://jobs.51job.com/all/',
        'User-Agent':'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36',
}
COMPANY_URL_51JOB = 'http://jobs.51job.com/all/co{cid}.html'


# config for postgres

if __name__ == '__main__':
    pass